﻿using AutoMapper;
using WeatherHistory.Api.CommandsQueries.Mapping;
using WeatherHistory.Data.Entities;

namespace WeatherHistory.Api.CommandsQueries.Queries.RegionTypes.GetOne;

public class GetOneRegionTypesQueryResponse : IMapWith<RegionType>
{
    public long Id { get; set; }
    public string Type { get; set; } = null!;

    public void Mapping(Profile profile)
    {
        profile.CreateMap<RegionType, GetOneRegionTypesQueryResponse>()
            .ForMember(dest => dest.Id,
                opt => opt.MapFrom(src => src.Id))
            .ForMember(dest => dest.Type,
                opt => opt.MapFrom(src => src.Name));
    }
}